package com.xy.test.controller;


import com.xy.test.service.OrderService;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;
    @RequestMapping("/createTccOrder/{id}")
    public void createTccOrder(@PathVariable(value = "id") Integer id) {
        orderService.createTccOrder(id);
    }

    @RequestMapping("/createOrder/{id}")
    public void createOrder2(@PathVariable(value = "id") Integer id) {
        orderService.createOrder(id);
    }

    @RequestMapping("/createOrder")
    public void createOrder() {
        orderService.createOrder(0);
    }

}
